Skip to content

Conversation

@jkebinger
Copy link
Collaborator

Summary

  • Reduced log level for expected SSE timeout errors from error to debug
  • Changed SSE client to use last_event_id parameter instead of relying on Last-Event-ID header for proper reconnection handling
  • Added tests to verify last_event_id parameter is correctly passed to SSE::Client

Details

  1. Quieter logging for expected SSE timeouts: OpenSSL::SSL::SSLError with "unexpected eof" occurs when SSE sessions close normally after timeout (every ~5 minutes). This is expected behavior, so changed from error-level to debug-level logging.

  2. Proper last_event_id handling: Pass last_event_id directly to SSE::Client.new so the library can handle reconnections properly. The value is:

    • Stringified when highwater_mark is positive
    • nil when highwater_mark is nil or 0
  3. Test updates: Removed assertions on Last-Event-ID header and added new test to verify last_event_id parameter behavior.

🤖 Generated with Claude Code

jkebinger and others added 3 commits October 6, 2025 18:27
OpenSSL::SSL::SSLError with "unexpected eof" occurs when SSE sessions
close normally after timeout. Changed to debug level to reduce noise
while preserving error logging for actual problems.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Instead of relying on the Last-Event-ID header, pass last_event_id
as a parameter to SSE::Client.new. This allows the client library to
handle reconnections properly. Only pass a string value when
highwater_mark is positive; pass nil for nil or zero values.

Updated tests to verify the last_event_id parameter and removed
assertions on the Last-Event-ID header.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

@jdwyah jdwyah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@jkebinger jkebinger merged commit b30bd4b into main Oct 6, 2025
4 checks passed
@jkebinger jkebinger deleted the quiet-sse-eof-errors branch October 6, 2025 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants